package com.chengzhi.disruptor.heigh;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;

import java.math.BigDecimal;
import java.time.LocalDateTime;

public class TradeHandler1 implements EventHandler<Trade>, WorkHandler<Trade> {

    @Override
    public void onEvent(Trade event, long sequence, boolean endOfBatch) throws Exception {
        this.onEvent(event);
    }

    @Override
    public void onEvent(Trade event) throws Exception {
        System.out.println(LocalDateTime.now() + "  [op:TradeHandler1]------------onEvent " + event.toString());
        event.setPrice(new BigDecimal("11"));
    }
}
